Component({
  pageLifetimes: {
    show() {
      if (typeof this.getTabBar === 'function' &&
        this.getTabBar()) {
        this.getTabBar().setData({
          selected: 0
        })
      }
    }
  },
  data: {
    banner: [{
        img: "https://images.pexels.com/photos/2373882/pexels-photo-2373882.jpeg?auto=compress&cs=tinysrgb&w=1600"
      },
      {
        img: "https://images.pexels.com/photos/326055/pexels-photo-326055.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"
      },
      {
        img: "https://images.pexels.com/photos/414612/pexels-photo-414612.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"
      },
    ],
    nav: [{
        img: "../../assets/image/nav.png",
        name: "功能1"
      },
      {
        img: "../../assets/image/nav.png",
        name: "功能2"
      },
      {
        img: "../../assets/image/nav.png",
        name: "功能3"
      },
      {
        img: "../../assets/image/nav.png",
        name: "功能4"
      },
      {
        img: "../../assets/image/nav.png",
        name: "功能5"
      },
    ],
    grid: [{
        img: "shopping-cart",
        name: "功能A",
        color: "blue"
      },
      {
        img: "setting",
        name: "功能B",
        color: "red"
      },
      {
        img: "fire",
        name: "功能C",
        color: "green"
      },
      {
        img: "cart-circle",
        name: "功能D",
        color: "gold"
      },
      {
        img: "gift",
        name: "功能E",
        color: "blue"
      },
      {
        img: "clear",
        name: "功能F",
        color: "blue"
      },
      {
        img: "todo-list",
        name: "功能G",
        color: "blue"
      },
      {
        img: "phone-circle",
        name: "功能H",
        color: "blue"
      },
      {
        img: "browsing-history",
        name: "功能I",
        color: "blue"
      },
      {
        img: "volume",
        name: "功能J",
        color: "blue"
      },
      {
        img: "",
        name: "",
        color: ""
      },
      {
        img: "",
        name: "",
        color: ""
      },
    ],
    show: false,
  },

  methods: {
    showPopup() {
      console.log(1);
      this.setData({
        show: true
      });
    },
    onClose() {
      this.setData({
        show: false
      });
    },
    click(e) {
      console.log(e.currentTarget.dataset.a.name === "功能B");
    },
  },

})